<template>
    <van-swipe :autoplay="3000" lazy-render>
        <van-swipe-item v-for="image in swipeData" :key="image">
            <img :src="image.pic" />
        </van-swipe-item>
    </van-swipe>
</template>

<script  setup>
import { ref,onMounted } from 'vue';
import { swipeApi } from '../../api/discovery'
const swipeData = ref()
const getdata=async()=>{
    
       let data  =  await swipeApi()
       swipeData.value = data.banners
    
}
onMounted(()=>{
    getdata()
})
</script>

<style scoped>
    img{
        width: 90%;
        border-radius:20px;
        margin: 16px;
    }
</style>